//package spitter.controller;
//
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import spitter.exceptions.DuplicateSpittleException;
//
//@Controller
//@RequestMapping("/spittles")
//public class SpittleController {
//
////    private Spittle
////
////    @RequestMapping()
//
//    @RequestMapping(value = "save",method = RequestMethod.GET)
//    public String saveSpittle() {
//        //save spittles.....
//        if (true) {
//            throw new DuplicateSpittleException();
//        }
//        return "redirect:/spittles";
//    }
//
//    //当抛出DuplicateSpittleExcetion异常的时候，将会委托该方法处理
//    @ExceptionHandler(DuplicateSpittleException.class)
//    public String handleDuplicateSpittle() {
//        return "error/duplicate";
//    }
//}
